<%--
  Created by IntelliJ IDEA.
  User: seal
  Date: 2016/3/26
  Time: 14:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>注册</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="/static/css/mircblog.css"/>
</head>
<body>
<!-- container -->
<div class="container">
    <form action="register.do" method="post" class="form-signin">
        <h2 class="form-signin-heading">用户注册</h2>
        <label for="inputUserName" class="sr-only">用户名</label>
        <input type="text" id="inputUserName"  name="nickName" class="form-control" placeholder="用户名" required autofocus>
        <label for="inputTelNo" class="sr-only">邮箱</label>
        <input type="text"  name="telNo" id="inputTelNo" class="form-control" placeholder="电话" required>
        <a id="register-bt" class="btn btn-lg btn-primary btn-block">注册</a>

    </form>

        <div id="msg" class="alert alert-danger" role="alert">
                ${error }
        </div>

</div>
<!-- container end -->
</body>

<script type="text/javascript" src="/static/jquery.min.js"></script>
<script type="text/javascript" src="/static/bootstrap.min.js"></script>
<script type="application/javascript">
    $(function(){

        $('#register-bt').click(function(){

            $.post("/other/token/register.do",{nickName:$('#inputUserName').val(),telNo:$('#inputTelNo').val()},function(data){
                if(data.state){
                    location.replace("/other/index.do");
                }else{
                    $('#error').html(data.msg);
                }
            });
            alert(1);
        });

    })
</script>
</html>
